package com.hs.sfzy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hs.sfzy.entity.PsyAss;
import com.hs.sfzy.entity.PsyTest;
import com.hs.sfzy.entity.PubCenter;
import com.hs.sfzy.mapper.PsyAssMapper;
import com.hs.sfzy.service.PsyAssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PsyAssServiceImpl implements PsyAssService {
    @Override
    public PsyAss selectById(int id) {
        return psyAssMapper.selectById(id);
    }

    @Autowired
    PsyAssMapper psyAssMapper;

    @Override
    public PageInfo<PsyAss> selectAll(PsyAss psyAss,int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<PsyAss> psyAsses = psyAssMapper.selectAll(psyAss);
        PageInfo<PsyAss> pageInfo = new PageInfo<>(psyAsses);
        return pageInfo;
    }
    @Override
    public PageInfo<PsyAss> selectByName(PsyAss psyAss, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<PsyAss> psyAsses = psyAssMapper.selectByName(psyAss);
        PageInfo<PsyAss> pageInfo = new PageInfo<>(psyAsses);
        return pageInfo;
    }
}
